package com.jackson.engineeringtechnologyguide.async;

/*
 * Author: JacksonCoder
 * FileName: AsyncServiceImpl
 * Version: 1.0.0
 * Date: 2025/1/11
 */

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult;

import java.util.concurrent.Future;

@Slf4j
public class AsyncServiceImpl implements AsyncService {


    @Async
    @Override
    public void asyncMethodNoReturn() throws InterruptedException {
        // TODO  业务逻辑
    }

    @Async
    @Override
    public Future<String> asyncMethodHasReturn() throws InterruptedException {

        //业务逻辑
        return new AsyncResult<>("qinyi");
    }
}